package com.smedi.ismedi.personnel.core.port.adapter.persistence.mybatis.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.smedi.ismedi.database.starter.annotation.SqlItem;
import com.smedi.ismedi.database.starter.annotation.SqlPermission;
import com.smedi.ismedi.database.starter.interceptor.permission.SqlItemEnum;
import com.smedi.ismedi.personnel.core.application.query.vo.InternalPersonAssignmentVo;
import com.smedi.ismedi.personnel.core.port.adapter.persistence.model.AssignmentEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: xulinjun
 * @Date: 2021-6-8 10:52
 */
@SqlPermission(
        {@SqlItem(item = SqlItemEnum.hrOrganization, table = AssignmentEntity.class)}
)
public interface InternalAssignmentMapper extends BaseMapper<InternalPersonAssignmentVo> {
    IPage<InternalPersonAssignmentVo> selectInternalAssignmentVoPagination(Page<InternalPersonAssignmentVo> page,
                                                                           @Param("hrOrganizationId") Long hrOrganizationId,
                                                                           @Param("lastName") String lastName,
                                                                           @Param("userName") String userName,
                                                                           @Param("employeeNum") String employeeNum);

    IPage<InternalPersonAssignmentVo> selectInternalAssignmentVoContainsHrOrganizationChildrenPagination(Page<InternalPersonAssignmentVo> page,
                                                                                                         @Param("segHrOrganizationIds") List<List<Long>> segHrOrganizationIds,
                                                                                                         @Param("lastName") String lastName,
                                                                                                         @Param("userName") String userName,
                                                                                                         @Param("employeeNum") String employeeNum);
}
